import { shallowMount } from "@vue/test-utils";
import ListBox from "../../components/ListBox";

describe("ListBox组件测试", () => {
  it('ListBox初始化时，应该接受一个空的list，并且count为0',()=>{
    const wrapper = shallowMount(ListBox,{
      propsData:{
        list:[]
      }
    });

    let countEl = wrapper.find('[data-test="count"]');
    let ListItems = wrapper.findAll('[data-test="item"]');

    expect(countEl.exists()).toBeTruthy();
    expect(countEl.text()).toEqual('0');
    expect(ListItems.length).toBe(0);


  })

});
